
<!-- BEGIN:main --> 

<script language="javascript" type="text/javascript">
    function submitForm(action, id1)
    {

        var id = $('#' + id1);

        var dataString = 'hdAction=' + action;
        dataString += '&id=' + id.val();

        $.ajax({
            url: '.?com=com_hanghoa',
            type: "POST",
            data: dataString,
            cache: false,
            success: function(data) {
                if (data.trim() == 'OK') {
//                    alert('Xóa thành công');
                    window.location.reload();
                }
            }
        });


    }
</script> 

<form method="post" name="phpForm" id="phpForm" action="">
    <!--biến giá trị hành động-->
    <input type="hidden" name="hdAction" id="hdAction" />

    <div align="center" data-role="content" id="contentConfirmation" name="contentConfirmation" >  
        <ul data-role="listview" data-inset="true">
            <li data-role="list-divider">DANH MỤC HÀNG HÓA</li>
            <!-- BEGIN:hanghoa -->

            <li>
                <input type="hidden" name="{H_ID}" id="{H_ID}" value="{H_ID}"/>

                <a href="./?com=com_hanghoa&task=edit&idhanghoa={H_ID}">
                    <!--<input id="cb{INDEX_CHECKBOX}" name="cid[]" value="{H_ID}" onclick="isChecked(this.checked);" type="checkbox">--> 
                    <h3>Tên hàng hóa: {H_TEN}</h3>
                    <p>Giá nhập: {H_GIA_NHAP} (VNĐ)</p>
                    <a href="#popupDialog{H_ID}" data-rel="popup" data-position-to="window" data-inline="true" data-transition="pop" data-icon="delete" data-theme="b">Xóa</a>
                    </a>
                    <div data-role="popup" id="popupDialog{H_ID}" data-overlay-theme="a" data-theme="c" data-dismissible="false" style="max-width:400px;" class="ui-corner-all">
                    <div data-role="header" data-theme="a" class="ui-corner-top">
                        <h1>Xóa hàng hóa</h1>
                    </div>
                    <div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
                        <h3 class="ui-title">Bạn có chắc là muốn xóa {H_TEN}?</h3>
                        <p>Hành động này không thể quay lại.</p>
                        <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Bỏ qua</a>
                        <a href="javascript:void(0)" onclick="submitForm('remove', {H_ID});" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Xóa</a>
                    </div>
                </div>
                </a>

            </li>
            <!-- END:hanghoa -->          

        </ul>
    </div>
    <div data-role="footer" data-theme="b" data-position="fixed">
        <div class="ui-bar">
            <a href="./?com=com_hanghoa&task=add" data-role="button" data-icon="plus" data-theme="b" data-transition="fade" style="float:left;" >Thêm hàng hóa</a>
            <a href="./?com=com_danhmuc" data-role="button" data-icon="refresh" data-theme="b" style="float:right;">Trở lại</a>
        </div>
    </div>   
</form>
<!-- END:main -->
